package com.qixin.part.controller;


import com.alibaba.fastjson.JSONObject;
import com.qixin.api.bean.ComCar;
import com.qixin.api.bean.WeCarsource;
import com.qixin.api.service.ComCarService;
import com.qixin.api.service.WeCarsourceService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ResponseBody;

import java.sql.SQLException;
import java.util.Date;

/**
 * <p>
 * 车源加盟 前端控制器
 * </p>
 *
 * @author 何爱国
 * @since 2018-11-07
 */
@Controller
@RequestMapping("/weCarsource")
public class WeCarsourceController {
    private static final Logger logger = LoggerFactory.getLogger(WeCarsourceController.class);
    @Autowired
    WeCarsourceService weCarsourceService;
    /**
     * 车源加盟添加
     * @return
     */
    @RequestMapping("/insert")
    @ResponseBody
    public Boolean insert(String param) {
        logger.info(param);
        WeCarsource weCarsource = JSONObject.parseObject(param, WeCarsource.class);
if (weCarsourceService.insertCar(weCarsource)){
    return true;
}
        return false;
    }

}